﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CadastrarEmpresa.aspx.cs" 
    Inherits="BuscadorDePreco.CadastrarEmpresa" MasterPageFile="~/InnerMaster.master" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentTitleDiv" runat="server">
    <h1>
    <span><a href="/Empresas.aspx" alt="">Empresas</a>/ </span>Nova Empresa
    </h1>
    <script src="Scripts/Utils.js" type="text/javascript"></script>
    <script src="Scripts/CadastrarEmpresa.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        function uploadError(sender, args) {
            document.getElementById('lblStatus').innerText = args.get_fileName(),
	        "<span style='color:red;'>" + args.get_errorMessage() + "</span>";
        }
    </script>
</asp:Content>

    <%--<link href="Styles/Cadastros.css" rel="stylesheet" type="text/css" />
    <title>Cadastrar empresa</title>--%>
    
<asp:Content ID="Content2" ContentPlaceHolderID="ContentInputs" runat="server">
<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div class="inputs">
		<div class="column2">
			<ul>
				<li>Telefone 1: <asp:TextBox runat="server" ID="Telefone1Tb"></asp:TextBox></li>
				<li>Telefone 2: <asp:TextBox runat="server" ID="Telefone2Tb"></asp:TextBox></li>
				<li>Website: <asp:TextBox runat="server" ID="UrlTb"></asp:TextBox></li>
				<li>E-mail: <asp:TextBox runat="server" ID="EmailTb"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="Email_RegularExpressionValidator" runat="server" ErrorMessage="E-mail inválido." 
                                                    ControlToValidate="EmailTb" ValidationExpression="^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$"
                                                    style="width: 80px;margin-top: 8px;position: absolute;font-size: 10px;"></asp:RegularExpressionValidator>
                </li>
                		
                <li style="float: right;">
                    <label style="float:left;margin-top: 6px;">Logomarca:</label>
                    <ajaxToolkit:AsyncFileUpload OnClientUploadError="uploadError" style="float:left;"
                    ErrorBackColor="Red" UploadingBackColor="Gray" CompleteBackColor="LightGray"
                    runat="server" ID="AsyncFileUpload" Width="350px" UploaderStyle="Modern"
                    ThrobberID="Throbber" OnUploadedComplete="AsyncFileUpload_OnUploadComplete" />
                    <asp:Label ID="Throbber" runat="server" Style="display: none">
                        <img src="Resources/Images/loading.gif" align="absmiddle" alt="loading" />
                    </asp:Label>
                    <asp:Label ID="lblStatus" runat="server" Style="font-family: Arial; font-size: small; width: 350px !important;"></asp:Label>
                </li>
			</ul>					
		</div>
		<div class="column1">
			<ul>
				<li>Nome da empresa: <asp:TextBox runat="server" ID="NomeEmpresaTb"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="NomeEmpresaValidator" runat="server" ErrorMessage="O nome da empresa não pode ficar em branco." Display="Dynamic" ControlToValidate="NomeEmpresaTb">
                    </asp:RequiredFieldValidator></li>
				<li>Razão Social: <asp:TextBox runat="server" ID="RazaoSocialTb"></asp:TextBox></li>
				<li>CNPJ (somente números): <asp:TextBox runat="server" ID="CNPJTb" MaxLength="18" onKeyPress="MascaraCNPJ(form1.CNPJTb);"></asp:TextBox></li>
				<li>Endereço: <asp:TextBox runat="server" ID="EnderecoTb"></asp:TextBox></li>
				<li>Cidade: <asp:TextBox runat="server" ID="CidadeTb">Uberlândia</asp:TextBox></li>
				<li>Estado:
                    <asp:DropDownList runat="server" ID="EstadoDDL">
                        <asp:ListItem Text="Acre" Value="AC"></asp:ListItem>
                        <asp:ListItem Text="Alagoas" Value="AL"></asp:ListItem>
                        <asp:ListItem Text="Amapá" Value="AP"></asp:ListItem>
                        <asp:ListItem Text="Amazonas" Value="AM"></asp:ListItem>
                        <asp:ListItem Text="Bahia" Value="BA"></asp:ListItem>
                        <asp:ListItem Text="Ceará" Value="CE"></asp:ListItem>
                        <asp:ListItem Text="Distrito Federal" Value="DF"></asp:ListItem>
                        <asp:ListItem Text="Espírito Santo" Value="ES"></asp:ListItem>
                        <asp:ListItem Text="Goiás" Value="GO"></asp:ListItem>
                        <asp:ListItem Text="Maranhão" Value="MA"></asp:ListItem>
                        <asp:ListItem Text="Mato Grosso" Value="MT"></asp:ListItem>
                        <asp:ListItem Text="Mato Grosso do Sul" Value="MS"></asp:ListItem>
                        <asp:ListItem Text="Minas Gerais" Value="MG" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="Pará" Value="PA"></asp:ListItem>
                        <asp:ListItem Text="Paraíba" Value="PB"></asp:ListItem>
                        <asp:ListItem Text="Paraná" Value="PR"></asp:ListItem>
                        <asp:ListItem Text="Pernambuco" Value="PE"></asp:ListItem>
                        <asp:ListItem Text="Piauí" Value="PI"></asp:ListItem>
                        <asp:ListItem Text="Rio de Janeiro" Value="RJ"></asp:ListItem>
                        <asp:ListItem Text="Rio Grande do Norte" Value="RN"></asp:ListItem>
                        <asp:ListItem Text="Rio Grande do Sul" Value="RS"></asp:ListItem>
                        <asp:ListItem Text="Rondônia" Value="RO"></asp:ListItem>
                        <asp:ListItem Text="Roraima" Value="RR"></asp:ListItem>
                        <asp:ListItem Text="Santa Catarina" Value="SC"></asp:ListItem>
                        <asp:ListItem Text="São Paulo" Value="SP"></asp:ListItem>
                        <asp:ListItem Text="Sergipe" Value="SE"></asp:ListItem>
                        <asp:ListItem Text="Tocantins" Value="TO"></asp:ListItem>
                    </asp:DropDownList></li>
			</ul>
		</div>

        <div>
            <asp:Label ID="ResultadoCadastroLbl" runat="server" Visible="false" Text="" Style="color: Blue;"></asp:Label>
        </div>

		<div style="float:right;border-top:1px solid #bfbfbf; width:45%; margin-top:1%; padding:2% 30% 0 0;">
			<asp:Button runat="server" ID="CadastrarBtn" Text="Cadastrar" onclick="CadastrarBtn_Click" />
                    
            <input type="button" value="Limpar campos" onclick="limpaFormulario();" />
		</div>
	</div>
</form>
</asp:Content>
<%--<form id="formularioCadastro" runat="server">
    <asp:ScriptManager ID="ScriptManager" runat="server"></asp:ScriptManager>
    <div class="content">
		<div class="header">
			<img class="logo-register" src="Resources/Images/logo-register.png" />
			<img class="register-title" src="Resources/Images/register-title.png" />
            <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutAction="Redirect" LogoutPageUrl="~/Default.aspx" />
		</div>
		<div class="middle">
			<div class="inputs">
				<div class="column2">
					<ul>
						<li>Telefone 1: <asp:TextBox runat="server" ID="Telefone1Tb"></asp:TextBox></li>
						<li>Telefone 2: <asp:TextBox runat="server" ID="Telefone2Tb"></asp:TextBox></li>
						<li>Website: <asp:TextBox runat="server" ID="UrlTb"></asp:TextBox></li>
						<li>E-mail: <asp:TextBox runat="server" ID="EmailTb"></asp:TextBox></li>
                        <asp:RegularExpressionValidator ID="Email_RegularExpressionValidator" runat="server" ErrorMessage="E-mail inválido." ControlToValidate="EmailTb" ValidationExpression="^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$"></asp:RegularExpressionValidator>
						
                        <li>
                            <ajaxToolkit:AsyncFileUpload OnClientUploadError="uploadError"
                            ErrorBackColor="Red" UploadingBackColor="Gray" CompleteBackColor="LightGray"
                            runat="server" ID="AsyncFileUpload" Width="350px" UploaderStyle="Modern"
                            ThrobberID="Throbber" OnUploadedComplete="AsyncFileUpload_OnUploadComplete" />
                            <asp:Label ID="Throbber" runat="server" Style="display: none">
                                <img src="Resources/Images/loading.gif" align="absmiddle" alt="loading" />
                            </asp:Label>
                            <asp:Label ID="lblStatus" runat="server" Style="font-family: Arial; font-size: small; width: 350px !important;"></asp:Label>
                        </li>
					</ul>					
				</div>
				<div class="column1">
					<ul>
						<li>Nome da empresa: <asp:TextBox runat="server" ID="NomeEmpresaTb"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="NomeEmpresaValidator" runat="server" ErrorMessage="O nome da empresa não pode ficar em branco." Display="Dynamic" ControlToValidate="NomeEmpresaTb">
                            </asp:RequiredFieldValidator></li>
						<li>Razão Social: <asp:TextBox runat="server" ID="RazaoSocialTb"></asp:TextBox></li>
						<li>CNPJ (somente números): <asp:TextBox runat="server" ID="CNPJTb" MaxLength="18" onKeyPress="MascaraCNPJ(form1.CNPJTb);"></asp:TextBox></li>
						<li>Endereço: <asp:TextBox runat="server" ID="EnderecoTb"></asp:TextBox></li>
						<li>Cidade: <asp:TextBox runat="server" ID="CidadeTb">Uberlândia</asp:TextBox></li>
						<li>Estado:
                            <asp:DropDownList runat="server" ID="EstadoDDL">
                                <asp:ListItem Text="Acre" Value="AC"></asp:ListItem>
                                <asp:ListItem Text="Alagoas" Value="AL"></asp:ListItem>
                                <asp:ListItem Text="Amapá" Value="AP"></asp:ListItem>
                                <asp:ListItem Text="Amazonas" Value="AM"></asp:ListItem>
                                <asp:ListItem Text="Bahia" Value="BA"></asp:ListItem>
                                <asp:ListItem Text="Ceará" Value="CE"></asp:ListItem>
                                <asp:ListItem Text="Distrito Federal" Value="DF"></asp:ListItem>
                                <asp:ListItem Text="Espírito Santo" Value="ES"></asp:ListItem>
                                <asp:ListItem Text="Goiás" Value="GO"></asp:ListItem>
                                <asp:ListItem Text="Maranhão" Value="MA"></asp:ListItem>
                                <asp:ListItem Text="Mato Grosso" Value="MT"></asp:ListItem>
                                <asp:ListItem Text="Mato Grosso do Sul" Value="MS"></asp:ListItem>
                                <asp:ListItem Text="Minas Gerais" Value="MG" Selected="True"></asp:ListItem>
                                <asp:ListItem Text="Pará" Value="PA"></asp:ListItem>
                                <asp:ListItem Text="Paraíba" Value="PB"></asp:ListItem>
                                <asp:ListItem Text="Paraná" Value="PR"></asp:ListItem>
                                <asp:ListItem Text="Pernambuco" Value="PE"></asp:ListItem>
                                <asp:ListItem Text="Piauí" Value="PI"></asp:ListItem>
                                <asp:ListItem Text="Rio de Janeiro" Value="RJ"></asp:ListItem>
                                <asp:ListItem Text="Rio Grande do Norte" Value="RN"></asp:ListItem>
                                <asp:ListItem Text="Rio Grande do Sul" Value="RS"></asp:ListItem>
                                <asp:ListItem Text="Rondônia" Value="RO"></asp:ListItem>
                                <asp:ListItem Text="Roraima" Value="RR"></asp:ListItem>
                                <asp:ListItem Text="Santa Catarina" Value="SC"></asp:ListItem>
                                <asp:ListItem Text="São Paulo" Value="SP"></asp:ListItem>
                                <asp:ListItem Text="Sergipe" Value="SE"></asp:ListItem>
                                <asp:ListItem Text="Tocantins" Value="TO"></asp:ListItem>
                            </asp:DropDownList></li>
					</ul>
				</div>

                <div>
                    <asp:Label ID="ResultadoCadastroLbl" runat="server" Visible="false" Text="" Style="color: Blue;"></asp:Label>
                </div>

				<div style="float:right;border-top:1px solid #bfbfbf; width:45%; margin-top:1%; padding:2% 30% 0 0;">
					<asp:Button runat="server" ID="CadastrarBtn" Text="Cadastrar" onclick="CadastrarBtn_Click" />
                    
                    <input type="button" value="Limpar campos" onclick="limpaFormulario();" />
				</div>
			</div>
		</div>
		<div class="footer">
			<div class="separator"></div>
			<p>© 2013 Buscador de Preço · Todos os direitos reservados</p>
		</div>
	</div>
</form>--%>
    <%--<form id="form1" runat="server" enctype="multipart/form-data">
    <asp:ScriptManager ID="ScriptManager" runat="server"></asp:ScriptManager>
    <div>
        <h1>Cadastro de empresa</h1>
    </div>
    <div>
        <span>Nome da empresa: </span> <asp:TextBox runat="server" ID="NomeEmpresaTb" Width="341px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="NomeEmpresaValidator" runat="server" ErrorMessage="O nome da empresa não pode ficar em branco." Display="Dynamic" ControlToValidate="NomeEmpresaTb">
        </asp:RequiredFieldValidator>

        <br />
        <span>Razão Social: </span> <asp:TextBox runat="server" ID="RazaoSocialTb" Width="373px"></asp:TextBox>
        <br />
        <span>CNPJ (somente números): </span> <asp:TextBox runat="server" ID="CNPJTb" MaxLength="18" onKeyPress="MascaraCNPJ(form1.CNPJTb);"></asp:TextBox>
        <br />
        <span>Endereço: </span> <asp:TextBox runat="server" ID="EnderecoTb" Width="376px"></asp:TextBox>
        <br />
        <span>Cidade: </span> <asp:TextBox runat="server" ID="CidadeTb" Width="376px">Uberlândia</asp:TextBox>
        <br />
        <span>Estado: </span>  
        <asp:DropDownList runat="server" ID="EstadoDDL">
            <asp:ListItem Text="Acre" Value="AC"></asp:ListItem>
            <asp:ListItem Text="Alagoas" Value="AL"></asp:ListItem>
            <asp:ListItem Text="Amapá" Value="AP"></asp:ListItem>
            <asp:ListItem Text="Amazonas" Value="AM"></asp:ListItem>
            <asp:ListItem Text="Bahia" Value="BA"></asp:ListItem>
            <asp:ListItem Text="Ceará" Value="CE"></asp:ListItem>
            <asp:ListItem Text="Distrito Federal" Value="DF"></asp:ListItem>
            <asp:ListItem Text="Espírito Santo" Value="ES"></asp:ListItem>
            <asp:ListItem Text="Goiás" Value="GO"></asp:ListItem>
            <asp:ListItem Text="Maranhão" Value="MA"></asp:ListItem>
            <asp:ListItem Text="Mato Grosso" Value="MT"></asp:ListItem>
            <asp:ListItem Text="Mato Grosso do Sul" Value="MS"></asp:ListItem>
            <asp:ListItem Text="Minas Gerais" Value="MG" Selected="True"></asp:ListItem>
            <asp:ListItem Text="Pará" Value="PA"></asp:ListItem>
            <asp:ListItem Text="Paraíba" Value="PB"></asp:ListItem>
            <asp:ListItem Text="Paraná" Value="PR"></asp:ListItem>
            <asp:ListItem Text="Pernambuco" Value="PE"></asp:ListItem>
            <asp:ListItem Text="Piauí" Value="PI"></asp:ListItem>
            <asp:ListItem Text="Rio de Janeiro" Value="RJ"></asp:ListItem>
            <asp:ListItem Text="Rio Grande do Norte" Value="RN"></asp:ListItem>
            <asp:ListItem Text="Rio Grande do Sul" Value="RS"></asp:ListItem>
            <asp:ListItem Text="Rondônia" Value="RO"></asp:ListItem>
            <asp:ListItem Text="Roraima" Value="RR"></asp:ListItem>
            <asp:ListItem Text="Santa Catarina" Value="SC"></asp:ListItem>
            <asp:ListItem Text="São Paulo" Value="SP"></asp:ListItem>
            <asp:ListItem Text="Sergipe" Value="SE"></asp:ListItem>
            <asp:ListItem Text="Tocantins" Value="TO"></asp:ListItem>
        </asp:DropDownList>
        <br />
        <span>Telefone 1: </span> <asp:TextBox runat="server" ID="Telefone1Tb" Width="130px"></asp:TextBox>
        <br />
        <span>Telefone 2: </span> <asp:TextBox runat="server" ID="Telefone2Tb" Width="132px"></asp:TextBox>
        <br />
        <span>E-mail: </span> <asp:TextBox runat="server" ID="EmailTb" Width="187px"></asp:TextBox>
        <asp:RegularExpressionValidator ID="regexEmailValid" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ControlToValidate="EmailTb" ErrorMessage="E-mail digitado incorretamente."></asp:RegularExpressionValidator>
        <br />
        <span>Url: </span> <asp:TextBox runat="server" ID="UrlTb" Width="534px"></asp:TextBox>
        <br />
        <ajaxToolkit:AsyncFileUpload OnClientUploadError="uploadError"
                ErrorBackColor="Red" UploadingBackColor="Gray" CompleteBackColor="LightGray"
                runat="server" ID="AsyncFileUpload" Width="400px" UploaderStyle="Modern"
                ThrobberID="Throbber" OnUploadedComplete="AsyncFileUpload_OnUploadComplete" />
                <asp:Label ID="Throbber" runat="server" Style="display: none">
                <img src="Resources/Images/loading.gif" align="absmiddle" alt="loading" />
            </asp:Label>
            <asp:Label ID="lblStatus" runat="server" Style="font-family: Arial; font-size: small;"></asp:Label>
        <br />
        <br />
        <asp:Button runat="server" ID="CadastrarBtn" Text="Cadastrar" onclick="CadastrarBtn_Click" />
    </div>
    </form>--%>

